package com.aopproxy;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.stereotype.Component;

@Component
@Aspect
//proxyTargetClass = true 强制spring用继承的方式生成代理类
//不管目标对象有没有实现接口
@EnableAspectJAutoProxy(proxyTargetClass = true)
public class MyLog {

    @Before("execution(* com.aopproxy.IntfAImpl.doSth())")
    public void before() {
        System.out.println("before---");
    }
}
